﻿Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports FileManipulationSQLCLRExternal.SharedObjects

Partial Public Class StoredProcedures
    <Microsoft.SqlServer.Server.SqlProcedure()> _
    Shared Function MSPMakeDirectory(ByVal FullDirectoryPath As SqlString) As Integer
        Try
            If FolderExistsCheck(CType(FullDirectoryPath, String)) = False Then
                System.IO.Directory.CreateDirectory(CType(FullDirectoryPath, String))
            End If

            Return 0
        Catch sqlex As SqlException
            ShowError(sqlex.ToString)

            Return 1
        Catch ex As Exception
            ShowError(ex.ToString)

            Return 1
        End Try
    End Function
End Class
